#ifndef __MEMORY_TOP_H__
#define __MEMORY_TOP_H__

#include <systemc>

#include "tlm.h"
#include "tlm_utils/simple_initiator_socket.h"
#include "tlm_utils/simple_target_socket.h"

using namespace sc_core;
using namespace sc_dt;
using namespace std;
using namespace tlm_utils;

class memory_top: public sc_core::sc_module{

public:
  SC_HAS_PROCESS(memory_top);
  tlm_utils::simple_target_socket<memory_top> socket;

  enum {SIZE = 256};

  memory_top(const sc_module_name& name): socket("socket"){
    entry();
  }
  void entry();
  virtual void b_transport(tlm::tlm_generic_payload& trans, sc_time& delay);
  virtual unsigned int transport_dbg(tlm::tlm_generic_payload& trans);
  virtual bool get_direct_mem_ptr(tlm::tlm_generic_payload& trans, tlm::tlm_dmi& dmi_data);
  void invalidation_process();

private:
  int mem[SIZE];
  sc_time LATENCY;

};

#endif /* __MEMORY_TOP_H__ */
